#include<cstdio>
#include<cstring>
int main()
{
	freopen("test.in","r",stdin);
	freopen("test.out","w",stdout);
	int k,ans[71];
	char s[71];
	scanf("%d",&k) ;
	while(k != 0 )
	{
		scanf("%s",s) ;
		int n = strlen(s);
		for(int i = 0 ; i < n ; i++ )
		{
			int t;
			if(s[i]=='.')t = 27;
			if(s[i]=='_')t = 0;
			if(s[i] >= 'a' && s[i] <= 'z') t = s[i] - 'a' + 1;
			ans[k*i%n] = ( t + i ) % 28;
		}
		for(int i = 0; i < n ; i++)
		{
			if(ans[i] >=1 && ans[i] <= 26)printf("%c",ans[i]+'a'-1);
			if(ans[i] == 0) printf("_");
			if(ans[i] == 27) printf(".");
		}
		printf("\n");
		scanf("%d",&k) ;

	}
	return 0;
}



